import { lazy } from "react";
import * as Type from "@/utils/index";

export const childrenRoutes: Type.RouterList = [
  {
    path: "/main/home",
    element: lazy(() => import("@/views/main/Home")),
    title: "home",
  },
  {
    path: "/main/my",
    element: lazy(() => import("@/views/main/My")),
    title: "my",
  },
];

const routes: Type.RouterList = [
  {
    path: "/",
    to: "/main/home",
  },
  {
    path: "/main",
    element: lazy(() => import("@/views/Main")),
    title: "main",
    children: childrenRoutes,
  },
  {
    path: "/login",
    element: lazy(() => import("@/views/Login")),
    title: "login",
  },
  {
    path: "/pay",
    element: lazy(() => import("@/views/Pay")),
    title: "pay",
  },
  {
    path: "/gotoPay",
    element: lazy(() => import("@/views/GotoPay")),
    title: "gotopay",
  },
  {
    path: "*",
    element: lazy(() => import("@/views/Error")),
    title: "error",
  },
];

export default routes;
